using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class ReportItemsTypeComposite : Hashtable
    {

        public ReportItemsTypeComposite()
        {
        }

        public ReportItemsType Write()
        {
            ReportItemsType reportItemsType = new ReportItemsType();
            ArrayList arrayList = new ArrayList();
            foreach (object obj in Values)
            {
                if ((obj as TextboxType))
                {
                    arrayList.Add(((TextboxType)obj).Write());
                }
                else
                {
                    if ((obj as ChartType))
                    {
                        arrayList.Add(((ChartType)obj).Write());
                        continue;
                    }
                    if ((obj as CustomReportItemType))
                    {
                        arrayList.Add(((CustomReportItemType)obj).Write());
                        continue;
                    }
                    if ((obj as ImageType))
                    {
                        arrayList.Add(((ImageType)obj).Write());
                        continue;
                    }
                    if ((obj as LineType))
                    {
                        arrayList.Add(((LineType)obj).Write());
                        continue;
                    }
                    if ((obj as ListType))
                    {
                        arrayList.Add(((ListType)obj).Write());
                        continue;
                    }
                    if ((obj as MatrixType))
                    {
                        arrayList.Add(((MatrixType)obj).Write());
                        continue;
                    }
                    if ((obj as RectangleType))
                    {
                        arrayList.Add(((RectangleType)obj).Write());
                        continue;
                    }
                    if ((obj as SubreportType))
                    {
                        arrayList.Add(((SubreportType)obj).Write());
                        continue;
                    }
                    if ((obj as TableType))
                        arrayList.Add(((TableType)obj).Write());
                }
            }
            reportItemsType.Items = arrayList.ToArray();
            arrayList = null;
            return reportItemsType;
        }

    } // class ReportItemsTypeComposite

}

